<template>
  <div class="agri-left">
    <dv-border-box-13 style="height: 300px; width: 610px; padding: 20px">
      <!-- <div class="top" style="height: 450px;">
      <div class="title">
        <img
          src="../../../assets/img/grovernance/moeny.png"
          height="20px"
          alt=""
        />
        <span>农时</span>
      </div>
      <div class="top-content">
        <div class="table-title">
          <div
            style="
              width: 0;
              height: 0;
              border-top: 5px solid transparent;
              border-bottom: 5px solid transparent;
              border-left: 10px solid;
              margin-right: 5px;
            "
          ></div>
          <span style="color: #bdffff">当月农时节点</span>
         </div>
      <div class="table">
      <table class="table-main">
        <tr style="color: white; font-size: 18px; font-weight: bold">
          <td>时间</td>
          <td>事件</td>
          <td>持续时间</td>

        </tr>
        <tr>
          <td>2024年1月23日</td>
          <td>播种</td>
          <td>3天</td>

        </tr>
        <tr>
          <td>2024年1月23日</td>
          <td>播种</td>
          <td>3天</td>

        </tr>
        <tr>
          <td>2024年1月23日</td>
          <td>播种</td>
          <td>3天</td>
        </tr>
        <tr>
          <td>2024年1月23日</td>
          <td>播种</td>
          <td>3天</td>

        </tr>
        <tr>
          <td>2024年1月23日</td>
          <td>播种</td>
          <td>3天</td>

        </tr>
      </table>
      
      </div>
      </div>   
    </div> -->
      <Echart height="300px" :options="option"></Echart>
    </dv-border-box-13>
    <dv-border-box-13
      style="height: 300px; width: 610px; padding: 20px; margin-top: 20px"
    >
      <!-- <div class="bottom">
      <div class="title">
        <img
          src="../../../assets/img/grovernance/moeny.png"
          height="20px"
          alt=""
        />
        <span>农业灾害预警</span>
      </div>
      <div class="bottom-content">
        <div class="table-title">
          <div
            style="
              width: 0;
              height: 0;
              border-top: 5px solid transparent;
              border-bottom: 5px solid transparent;
              border-left: 10px solid;
              margin-right: 5px;
            "
          ></div>
          <span style="color: #bdffff">当月农业灾害预警</span>
       </div>
       <div class="table">
      <table class="table-main" style="height: 300px;">
        <tr style="color: white; font-size: 18px; font-weight: bold">
          <td>预计时间</td>
          <td>事件</td>
          <td>持续时间</td>

        </tr>
        <tr>
          <td>2024年1月23日</td>
          <td>蝗虫</td>
          <td>3天</td>

        </tr>
        <tr>
          <td>2024年1月23日</td>
          <td>蝗虫</td>
          <td>3天</td>

        </tr>
        <tr>
          <td>2024年1月23日</td>
          <td>蝗虫</td>
          <td>3天</td>
        </tr>
        <tr>
          <td>2024年1月23日</td>
          <td>蝗虫</td>
          <td>3天</td>

        </tr>
        <tr>
          <td>2024年1月23日</td>
          <td>蝗虫</td>
          <td>3天</td>
        </tr>
      </table>
      
      </div>
      </div>
    </div> -->
      <Echart height="300px" :options="options1"></Echart>
    </dv-border-box-13>
    <dv-border-box-13
      style="height: 300px; width: 610px; padding: 20px; margin-top: 20px"
    >
      <Echart height="300px" :options="options2"></Echart>
    </dv-border-box-13>
  </div>
</template>

<script>
import Echart from "@/common/echart/index.vue";
import { option } from "@/common/echart/line-map.js";
export default {
  name: "agri-left",
  components: { Echart },
  data() {
    return {
      option: option,
      options1: {
        title: {
          text: "价格走势",
          top: 0,
          left: 60,
          textStyle: {
            color: "#fff",
          },
        },
        xAxis: {
          type: "category",
          data: ["1日", "2日", "3日", "4日", "5日", "6日", "7日"],
          axisLabel: {
            fontSize: 14,
            color: "#38ADC5",
          },
        },
        grid: {
          x: 40,
          y: 30,
          x2: 20,
          y2: 60,
        },
        legend: {
          // top: "90%",
        },
        // tooltip: {
        //   trigger: "axis",
        // },
        yAxis: {
          type: "value",
          min: 0,
          max: 50,
          interval: 10,
          axisLabel: {
            fontSize: 14,
            color: "#38ADC5",
          },
        },
        series: [
          {
            name: "最高价",
            type: "bar",
            stack: "Ad",
            tooltip: {
              valueFormatter: function (value) {
                return value + " ml";
              },
            },
            data: [21, 29, 18, 23, 19, 25, 16],
            barWidth: "20",
            emphasis: {
              itemStyle: {
                borderColor: "#fff",
                borderWidth: 2,
              },
            },
            itemStyle: {
              color: "#26617A",
            },
          },
          {
            name: "最低价",
            type: "bar",
            stack: "Ad",
            tooltip: {},
            data: [12, 15, 13, 18, 16, 25, 16],
            barWidth: "20",
            emphasis: {
              itemStyle: {
                borderColor: "#fff",
                borderWidth: 3,
              },
            },
            itemStyle: {
              color: "#38ADC5",
            },
          },
          {
            type: "line",
            name: "平均价",
            data: [18, 25, 29, 26, 31, 42, 28],
            areaStyle: {
              color: "rgba(56,173,197,0.3)",
            },
            symbolSize: 12,
            emphasis: {
              lineStyle: {
                color: "rgb(  54,240,174)",
              },
            },
            itemStyle: {
              // normal: {
              //   color: "#000", //改变折线点的颜色
              //   lineStyle: {
              //     color: "#1F824E", //改变折线颜色
              //   },
              // },
            },
          },
        ],
      },
      options2: {
        title: {
          text: "本周价格",
          top: 0,
          left: 60,
          textStyle: {
            color: "#fff",
          },
        },
        grid: {
          x: 40,
          y: 30,
          x2: 20,
          y2: 60,
        },
        xAxis: {
          type: "category",
          data: ["1日", "2日", "3日", "4日", "5日", "6日", "7日"],
          axisLabel: {
            fontSize: 14,
            color: "#38ADC5",
          },
        },
        yAxis: {
          type: "value",
          min: 0,
          max: 50,
          interval: 10,
          axisLabel: {
            fontSize: 14,
            color: "#38ADC5",
          },
        },
        tooltip: {
          trigger: "axis",
        },
        legend: {},
        series: [
          {
            type: "line",
            name: "本周价格",
            smooth: true,
            showSymbol: false,
            data: [15, 9, 16, 13, 31, 10, 15],
            areaStyle: {
              color: "rgba(56,173,197,0.3)",
            },
            symbolSize: 12,
          },
          {
            type: "line",
            name: "上周价格",
            smooth: true,
            showSymbol: false,
            data: [20, 28, 22, 20, 23, 16, 19],
            areaStyle: {
              color: "rgba( 38,240,169,0.2)",
            },
            lineStyle: {
              color: "#27F3A7",
            },
            symbolSize: 12,
          },
        ],
      },
    };
  },
};
</script>

<style scoped lang="scss">
.agri-left {
  flex: 1;
}

.bottom-content {
  margin-top: 10px;
}
.title {
  height: 40px;
  display: flex;
  justify-content: start;
  align-items: center;
  padding: 10px;
  background: linear-gradient(90deg, #288ad6 0%, #09306c 100%);
  span {
    margin-left: 10px;
    font-size: 22px;
    color: #dcd58a;
    font-weight: bold;
  }
}
.table-main {
  width: 100%;
  height: 370px;
  color: #bdffff;
  text-align: center;
  border-collapse: collapse;
  tr {
    background-color: #041f41;
  }
  tr:nth-child(even) {
    background-color: #071b5a;
  }
  td {
    border-left: 2px solid #023a64;
  }
}
.top-content {
  margin-top: 10px;
}
.table-title {
  display: flex;
  width: 200px;
  align-items: center;
  margin-bottom: 5px;
  padding-left: 10px;
}

tr:nth-child(1) td {
  border: 0;
  width: 30%;
}
</style>
